package com.example.design.core;

import lombok.Getter;

/**
 * 注册文件处理器信息
 */
@Getter
public class ProcessorRegistration<T extends Enum<T> & SyncFieldDefinition> {
    private final FileMatcher matcher;
    private final FileProcessor<T> processor;
    private final int priority;

    private ProcessorRegistration(FileMatcher matcher, FileProcessor<T> processor, int priority) {
        this.matcher = matcher;
        this.processor = processor;
        this.priority = priority;
    }

    public static <T extends Enum<T> & SyncFieldDefinition> ProcessorRegistration<T> of(
            FileMatcher matcher, FileProcessor<T> processor, int priority) {
        return new ProcessorRegistration<>(matcher, processor, priority);
    }

}
